package com.wn32.main.demo9;

public class MyService {
    public synchronized void m1(){
        try {
            Thread.sleep(5000);
            System.out.println(Thread.currentThread().getName()+": run-m1-ok");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
    public synchronized void m2(){
        try {
            Thread.sleep(5000);
            System.out.println(Thread.currentThread().getName()+": run-m2-ok");
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
